import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86184
 * Date: 2023-01-27
 * Time: 14:29
 */
public class Input_and_output {

    //生成随机数
    public static void main(String[] args) {
        Random rand=new Random();
        int n=rand.nextInt(100)+50;  // [0,100)---->[50,150)
        System.out.println(n);
    }

    //多组自定义输入输出
    public static void main2(String[] args) {
        Scanner scan = new Scanner(System.in);

        while(scan.hasNextInt()){
            System.out.println("请输入年龄：");
            int a=scan.nextInt();         //整数
            System.out.println("年龄："+a);
        }
    }

    //自定义输入
    public static void main1(String[] args) {
        // System.in   键盘
        Scanner scan = new Scanner(System.in);

        System.out.print("请输入姓名：");
        String b=scan.nextLine();       //一整行
        System.out.println("姓名:"+b);

        System.out.print("请输入年龄：");
        int a=scan.nextInt();         //整数
        System.out.println("年龄："+a);

        System.out.print("请输入学号：");
        int c=scan.nextInt();
        System.out.println("学号："+c);

    }
}


